<? if(!defined('SHARE_VERSION')) exit('Access Denied');?>
<?php include $this->display('header.html'); ?>
<div class="loading" id="loading"></div>
<?php if($this->operate == 'Index') { ?>
<div id="header-menu" attr="导航管理">
  <div class="menu-btn btn-selected"> <a href="#">fdsF</a>
    <div class="menu-btn-l"></div>
    <div class="menu-btn-r"></div>
    <div class="menu-item-down"></div>
  </div>
</div>
<div class="clear"></div>
<form name="myform" method="post" id="menu_form" action="<?php echo U('menu/update');?>">
<div id="main-body">
<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td class="title-1 c-item" width="30">ID</td>
    <td class="title-1 c-item">名称</td>
    <td class="title-1 c-item" width="120">排序</td>
    <td class="title-1 c-item" width="120">是否使用</td>
    <td class="title-2 c-item" width="150">操作</td>
  </tr>
  <?php foreach((array)$list as $key=>$vo) {?>
  <tr>
    <td class="td-0 c-item" height="20"><?php echo $vo['id'];?><input type="hidden" name="id[<?php echo $vo['id'];?>]" value="<?php echo $vo['id'];?>" /></td>
    <td class="td-1"><input type="text" name="name[<?php echo $vo['id'];?>]" value="<?php echo $vo['name'];?>" size="40" class="input-1" /></td>
    <td class="td-1 c-item"><input type="text" name="sort[<?php echo $vo['id'];?>]" value="<?php echo $vo['sort'];?>" size="10" class="input-1" style="width:30px;" /></td>
    <td class="td-1 c-item">
    <select name="is_use[<?php echo $vo['id'];?>]">
    <option value="1"<?php if($vo['is_use']==1) { ?> selected="selected"<?php } ?>>是</option>
    <option value="0"<?php if($vo['is_use']==0) { ?> selected="selected"<?php } ?>>否</option>
    </select>
    </td>
    <td class="td-2 c-item">删除</td>
  </tr>
  <?php }?>
  <tr>
    <td class="td-0 c-item" height="20">加<input type="hidden" name="id[]" value="0" /></td>
    <td class="td-1"><input type="text" name="name[]" value="" size="40" class="input-1" /></td>
    <td class="td-1 c-item"><input type="text" name="sort[]" value="" size="10" class="input-1" style="width:30px;" /></td>
    <td class="td-1 c-item">
    <select name="is_use[]">
    <option value="1">是</option>
    <option value="0">否</option>
    </select>
    </td>
    <td class="td-2 c-item">&nbsp;</td>
  </tr>
</table>
</div>
<div class="bottom-bar">
  <input type="submit" name="btn" value="保存" class="sbtn" />
</div>
</form>
<div class="clear"></div>
<script type="text/javascript">
function showRequest(formData, jqForm, options) { 
	$("#loading").show();
    return true; 
} 
// post-submit callback 
function showResponse(responseText, statusText, xhr)  { 
	parent.top.location.reload();
	window.location.reload();
	return false;
}
$(document).ready(function(){
	var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse  // post-submit callback 
    }; 
	$('#menu_form').submit(function() { 
        $(this).ajaxSubmit(options); 
        return false; 
    });
});
</script> 
<?php } elseif ($this->operate == 'add') { ?>
<?php } ?>
<?php include $this->display('footer.html'); ?>